import { CHANGEAADMINBASEINFOACTIVATE } from "../constants"

const initState = {

    baseAdminInfo: {
        form_data: [
            {
                key: 1,
                tasktitle: 'go分布式web系统',
                bounty: 99,
                startdate: '2022-04-21',
                enddate: '2022-05-01',
                audit: '0',
                type_name: '软件开发',
                nickname: '默哀不易',
                email: '14342332@qq.com',
                taskintro: '利用go开发语言, k8s开发思路进行分布式的web系统开发'
            },
        ], // 页面数据
        update_data: {}, // 审核后的单条数据
    }
}

export default function AdminReducer (preState=initState, action) {
    const {type, data} = action
    switch (type) {
        case CHANGEAADMINBASEINFOACTIVATE:
            return {
                ...preState,
                baseAdminInfo: Object.assign({}, preState.baseAdminInfo, data)
            }
        default:
            var state = preState
            return state
    }
}